<?php
$const_prefix = '_MI_' . strtoupper($mydirname);

$lang_dir = dirname(__FILE__) . '/language/';
if (file_exists($lang_file = $lang_dir . @$xoopsConfig['language'] . '/modinfo.php') || file_exists($lang_file = $lang_dir . 'english/modinfo.php')) {
    include $lang_file;
}

$modversion['dirname'] = $mydirname;
$modversion['name'] = constant($const_prefix.'_NAME');
$modversion['version'] = 3.0;
$modversion['description'] = constant($const_prefix.'_DESC');
$modversion['author']       = "docs/credits.txt";
$modversion['credits']      = "docs/credits.txt";
$modversion['help'] = "docs/install.txt";
$modversion['license']      = "docs/license.txt";
$modversion['official'] = 1;
$modversion['image'] = file_exists( $mydirpath.'/images/mylinks_slogo.png' ) ? 'images/mylinks_slogo.png' : 'module_icon.php';

// Any tables can't be touched by modulesadmin.
$modversion['sqlfile'] = false ;
$modversion['tables'] = array() ;

// Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = "admin/index.php";
$modversion['adminmenu'] = "admin/admin_menu.php";

// Blocks
$modversion['blocks'][1]['file'] = "blocks.php";
$modversion['blocks'][1]['name'] = constant($const_prefix.'_BNAME1');
$modversion['blocks'][1]['description'] = constant($const_prefix.'_BDESC1');
$modversion['blocks'][1]['show_func'] = "b_mylinks_top_show";
$modversion['blocks'][1]['edit_func'] = "b_mylinks_top_edit";
$modversion['blocks'][1]['options'] = "date|10|25|$mydirname|";
$modversion['blocks'][1]['template'] = '';
$modversion['blocks'][1]['can_clone'] = true;

$modversion['blocks'][2]['file'] = "blocks.php";
$modversion['blocks'][2]['name'] = constant($const_prefix.'_BNAME2');
$modversion['blocks'][2]['description'] = constant($const_prefix.'_BDESC2');
$modversion['blocks'][2]['show_func'] = "b_mylinks_top_show";
$modversion['blocks'][2]['edit_func'] = "b_mylinks_top_edit";
$modversion['blocks'][2]['options'] = "hits|10|25|$mydirname|";
$modversion['blocks'][2]['template'] = '';
$modversion['blocks'][2]['can_clone'] = true;

// Menu
$modversion['hasMain'] = 1;
$modversion['sub'][1]['name'] = constant($const_prefix.'_SMNAME1');
$modversion['sub'][1]['url'] = "submit.php";
$modversion['sub'][2]['name'] = constant($const_prefix.'_SMNAME2');
$modversion['sub'][2]['url'] = "topten.php?hit=1";
$modversion['sub'][3]['name'] = constant($const_prefix.'_SMNAME3');
$modversion['sub'][3]['url'] = "topten.php?rate=1";

// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "search.php";
$modversion['search']['func'] = $mydirname."_search";

// Comments
$modversion['hasComments'] = 1;
$modversion['comments']['itemName'] = 'lid';
$modversion['comments']['pageName'] = 'singlelink.php';
$modversion['comments']['extraParams'] = array('cid');
// Comment callback functions
$modversion['comments']['callbackFile'] = 'comment_functions.php';
$modversion['comments']['callback']['approve'] = 'mylinks_com_approve';
$modversion['comments']['callback']['update'] = 'mylinks_com_update';

// Templates
$modversion['templates'] = array() ;

// Config Settings (only for modules that need config settings generated automatically)

$modversion['config'][1]['name'] = 'popular';
$modversion['config'][1]['title'] = $constpref.'_POPULAR';
$modversion['config'][1]['description'] = $constpref.'_POPULARDSC';
$modversion['config'][1]['formtype'] = 'select';
$modversion['config'][1]['valuetype'] = 'int';
$modversion['config'][1]['default'] = 100;
$modversion['config'][1]['options'] = array('5' => 5, '10' => 10, '50' => 50, '100' => 100, '200' => 200, '500' => 500, '1000' => 1000);


$modversion['config'][2]['name'] = 'newlinks';
$modversion['config'][2]['title'] = $constpref.'_NEWLINKS';
$modversion['config'][2]['description'] = $constpref.'_NEWLINKSDSC';
$modversion['config'][2]['formtype'] = 'select';
$modversion['config'][2]['valuetype'] = 'int';
$modversion['config'][2]['default'] = 10;
$modversion['config'][2]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50);

$modversion['config'][3]['name'] = 'perpage';
$modversion['config'][3]['title'] = $constpref.'_PERPAGE';
$modversion['config'][3]['description'] = $constpref.'_PERPAGEDSC';
$modversion['config'][3]['formtype'] = 'select';
$modversion['config'][3]['valuetype'] = 'int';
$modversion['config'][3]['default'] = 10;
$modversion['config'][3]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50);

$modversion['config'][4]['name'] = 'anonpost';
$modversion['config'][4]['title'] = $constpref.'_ANONPOST';
$modversion['config'][4]['description'] = '';
$modversion['config'][4]['formtype'] = 'yesno';
$modversion['config'][4]['valuetype'] = 'int';
$modversion['config'][4]['default'] = 0;

$modversion['config'][5]['name'] = 'autoapprove';
$modversion['config'][5]['title'] = $constpref.'_AUTOAPPROVE';
$modversion['config'][5]['description'] = $constpref.'_AUTOAPPROVEDSC';
$modversion['config'][5]['formtype'] = 'yesno';
$modversion['config'][5]['valuetype'] = 'int';
$modversion['config'][5]['default'] = 0;

$modversion['config'][6]['name'] = 'frame';
$modversion['config'][6]['title'] = $constpref.'_USEFRAMES';
$modversion['config'][6]['description'] = $constpref.'_USEFRAMEDSC';
$modversion['config'][6]['formtype'] = 'yesno';
$modversion['config'][6]['valuetype'] = 'int';
$modversion['config'][6]['default'] = 0;

$modversion['config'][7]['name'] = 'useshots';
$modversion['config'][7]['title'] = $constpref.'_USESHOTS';
$modversion['config'][7]['description'] = $constpref.'_USESHOTSDSC';
$modversion['config'][7]['formtype'] = 'yesno';
$modversion['config'][7]['valuetype'] = 'int';
$modversion['config'][7]['default'] = 0;

$modversion['config'][8]['name'] = 'shotwidth';
$modversion['config'][8]['title'] = $constpref.'_SHOTWIDTH';
$modversion['config'][8]['description'] = $constpref.'_SHOTWIDTHDSC';
$modversion['config'][8]['formtype'] = 'textbox';
$modversion['config'][8]['valuetype'] = 'int';
$modversion['config'][8]['default'] = 140;

// Notification

$modversion['hasNotification'] = 1;
$modversion['notification']['lookup_file'] = 'notification.php';
$modversion['notification']['lookup_func'] = "{$mydirname}_notify_iteminfo";

$modversion['notification']['category'][1]['name'] = 'global';
$modversion['notification']['category'][1]['title'] = constant($constpref.'_GLOBAL_NOTIFY');
$modversion['notification']['category'][1]['description'] = constant($constpref.'_GLOBAL_NOTIFYDSC');
$modversion['notification']['category'][1]['subscribe_from'] = array('index.php','viewcat.php','singlelink.php');

$modversion['notification']['category'][2]['name'] = 'category';
$modversion['notification']['category'][2]['title'] = constant($constpref.'_CATEGORY_NOTIFY');
$modversion['notification']['category'][2]['description'] = constant($constpref.'_CATEGORY_NOTIFYDSC');
$modversion['notification']['category'][2]['subscribe_from'] = array('viewcat.php', 'singlelink.php');
$modversion['notification']['category'][2]['item_name'] = 'cid';
$modversion['notification']['category'][2]['allow_bookmark'] = 1;

$modversion['notification']['category'][3]['name'] = 'link';
$modversion['notification']['category'][3]['title'] = constant($constpref.'_LINK_NOTIFY');
$modversion['notification']['category'][3]['description'] = constant($constpref.'_LINK_NOTIFYDSC');
$modversion['notification']['category'][3]['subscribe_from'] = 'singlelink.php';
$modversion['notification']['category'][3]['item_name'] = 'lid';
$modversion['notification']['category'][3]['allow_bookmark'] = 1;

$modversion['notification']['event'][1]['name'] = 'new_category';
$modversion['notification']['event'][1]['category'] = 'global';
$modversion['notification']['event'][1]['title'] = constant($constpref.'_GLOBAL_NEWCATEGORY_NOTIFY');
$modversion['notification']['event'][1]['caption'] = constant($constpref.'_GLOBAL_NEWCATEGORY_NOTIFYCAP');
$modversion['notification']['event'][1]['description'] = constant($constpref.'_GLOBAL_NEWCATEGORY_NOTIFYDSC');
$modversion['notification']['event'][1]['mail_template'] = 'global_newcategory_notify';
$modversion['notification']['event'][1]['mail_subject'] = constant($constpref.'_GLOBAL_NEWCATEGORY_NOTIFYSBJ');

$modversion['notification']['event'][2]['name'] = 'link_modify';
$modversion['notification']['event'][2]['category'] = 'global';
$modversion['notification']['event'][2]['admin_only'] = 1;
$modversion['notification']['event'][2]['title'] = constant($constpref.'_GLOBAL_LINKMODIFY_NOTIFY');
$modversion['notification']['event'][2]['caption'] = constant($constpref.'_GLOBAL_LINKMODIFY_NOTIFYCAP');
$modversion['notification']['event'][2]['description'] = constant($constpref.'_GLOBAL_LINKMODIFY_NOTIFYDSC');
$modversion['notification']['event'][2]['mail_template'] = 'global_linkmodify_notify';
$modversion['notification']['event'][2]['mail_subject'] = constant($constpref.'_GLOBAL_LINKMODIFY_NOTIFYSBJ');

$modversion['notification']['event'][3]['name'] = 'link_broken';
$modversion['notification']['event'][3]['category'] = 'global';
$modversion['notification']['event'][3]['admin_only'] = 1;
$modversion['notification']['event'][3]['title'] = constant($constpref.'_GLOBAL_LINKBROKEN_NOTIFY');
$modversion['notification']['event'][3]['caption'] = constant($constpref.'_GLOBAL_LINKBROKEN_NOTIFYCAP');
$modversion['notification']['event'][3]['description'] = constant($constpref.'_GLOBAL_LINKBROKEN_NOTIFYDSC');
$modversion['notification']['event'][3]['mail_template'] = 'global_linkbroken_notify';
$modversion['notification']['event'][3]['mail_subject'] = constant($constpref.'_GLOBAL_LINKBROKEN_NOTIFYSBJ');

$modversion['notification']['event'][4]['name'] = 'link_submit';
$modversion['notification']['event'][4]['category'] = 'global';
$modversion['notification']['event'][4]['admin_only'] = 1;
$modversion['notification']['event'][4]['title'] = constant($constpref.'_GLOBAL_LINKSUBMIT_NOTIFY');
$modversion['notification']['event'][4]['caption'] = constant($constpref.'_GLOBAL_LINKSUBMIT_NOTIFYCAP');
$modversion['notification']['event'][4]['description'] = constant($constpref.'_GLOBAL_LINKSUBMIT_NOTIFYDSC');
$modversion['notification']['event'][4]['mail_template'] = 'global_linksubmit_notify';
$modversion['notification']['event'][4]['mail_subject'] = constant($constpref.'_GLOBAL_LINKSUBMIT_NOTIFYSBJ');

$modversion['notification']['event'][5]['name'] = 'new_link';
$modversion['notification']['event'][5]['category'] = 'global';
$modversion['notification']['event'][5]['title'] = constant($constpref.'_GLOBAL_NEWLINK_NOTIFY');
$modversion['notification']['event'][5]['caption'] = constant($constpref.'_GLOBAL_NEWLINK_NOTIFYCAP');
$modversion['notification']['event'][5]['description'] = constant($constpref.'_GLOBAL_NEWLINK_NOTIFYDSC');
$modversion['notification']['event'][5]['mail_template'] = 'global_newlink_notify';
$modversion['notification']['event'][5]['mail_subject'] = constant($constpref.'_GLOBAL_NEWLINK_NOTIFYSBJ');

$modversion['notification']['event'][6]['name'] = 'link_submit';
$modversion['notification']['event'][6]['category'] = 'category';
$modversion['notification']['event'][6]['admin_only'] = 1;
$modversion['notification']['event'][6]['title'] = constant($constpref.'_CATEGORY_LINKSUBMIT_NOTIFY');
$modversion['notification']['event'][6]['caption'] = constant($constpref.'_CATEGORY_LINKSUBMIT_NOTIFYCAP');
$modversion['notification']['event'][6]['description'] = constant($constpref.'_CATEGORY_LINKSUBMIT_NOTIFYDSC');
$modversion['notification']['event'][6]['mail_template'] = 'category_linksubmit_notify';
$modversion['notification']['event'][6]['mail_subject'] = constant($constpref.'_CATEGORY_LINKSUBMIT_NOTIFYSBJ');

$modversion['notification']['event'][7]['name'] = 'new_link';
$modversion['notification']['event'][7]['category'] = 'category';
$modversion['notification']['event'][7]['title'] = constant($constpref.'_CATEGORY_NEWLINK_NOTIFY');
$modversion['notification']['event'][7]['caption'] = constant($constpref.'_CATEGORY_NEWLINK_NOTIFYCAP');
$modversion['notification']['event'][7]['description'] = constant($constpref.'_CATEGORY_NEWLINK_NOTIFYDSC');
$modversion['notification']['event'][7]['mail_template'] = 'category_newlink_notify';
$modversion['notification']['event'][7]['mail_subject'] = constant($constpref.'_CATEGORY_NEWLINK_NOTIFYSBJ');

$modversion['notification']['event'][8]['name'] = 'approve';
$modversion['notification']['event'][8]['category'] = 'link';
$modversion['notification']['event'][8]['invisible'] = 1;
$modversion['notification']['event'][8]['title'] = constant($constpref.'_LINK_APPROVE_NOTIFY');
$modversion['notification']['event'][8]['caption'] = constant($constpref.'_LINK_APPROVE_NOTIFYCAP');
$modversion['notification']['event'][8]['description'] = constant($constpref.'_LINK_APPROVE_NOTIFYDSC');
$modversion['notification']['event'][8]['mail_template'] = 'link_approve_notify';
$modversion['notification']['event'][8]['mail_subject'] = constant($constpref.'_LINK_APPROVE_NOTIFYSBJ');

// Module administration callbacks
$modversion['onInstall'] = 'oninstall.php';
$modversion['onUpdate'] = 'onupdate.php';
$modversion['onUninstall'] = 'onuninstall.php';

// onUpdate
if( ! defined( 'XOOPS_CUBE_LEGACY' ) && substr( XOOPS_VERSION , 6 , 3 ) < 2.1 && ! empty( $_POST['fct'] ) && ! empty( $_POST['op'] ) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname'] ) {
	include dirname(__FILE__).'/include/keepblockoptions.inc.php' ;
}

?>